import http from '../../request/index'
export default(state)=>({
  getUserInfo(){ // 通过服务器获取用户信息
    http('xxx').then(result => { // 后端获取用户信息接口
      console.log('其实我只会返回一次内容')
      state.userInfo = {...state.userInfo,...result}
    })
  },
  getWxInfo(){ // 当用户授权后点击按钮促发
    let that = this
    uni.getUserInfo({
      provider: 'weixin',
      lang:'zh_CN',
      success: function (res) {
        console.log(res)
        that.getUserInfo()
      }
    })
  },
  setScene(data){
    state.userInfo = {...state.userInfo,...data}
  } 
})